package com.atguigu.juc_day01;

import com.atguigu.juc_day01.ticket_demo.TrainTicket;

public class ThreadDemo06 {
	public static void main(String[] args) {
		final TrainTicket trainTicket = new TrainTicket ();
		new Thread (()->{
			for (int i = 0; i < 500; i++) {
				trainTicket.sale ();
			}
		},"A").start ();
		new Thread (()->{
			for (int i = 0; i < 500; i++) {
				trainTicket.sale ();
			}
		},"B").start ();
		new Thread (()->{
			for (int i = 0; i < 500; i++) {
				trainTicket.sale ();
			}
		},"D").start ();
	}
}